package com.huawei.appmarket.service.store.awk.card;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;
import com.huawei.appgallery.foundation.card.base.card.BaseDistCard;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import o.chy;
import o.ehz;
import o.eqx;
import o.evx;
import o.ewm.e;
import o.exi;

public class MaterialRelatedListCard extends BaseDistCard<exi> {
    public MaterialRelatedListCard(Context context) {
        super(context);
    }

    public void ˊ(exi o_exi) {
        super.ˊ(o_exi);
        ॱ(o_exi);
        ʽ(o_exi.ॱ());
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
        if (cardBean instanceof ehz) {
            ehz o_ehz = (ehz) cardBean;
            eqx.ˏ(((exi) ʾ()).ʼ, o_ehz.ʻᐝ(), "image_default_icon");
            ˏ(((exi) ʾ()).ॱ, o_ehz.ʾॱ());
            ˏ(((exi) ʾ()).ˏ, o_ehz.ʽˊ());
            if (o_ehz.ʼᐝ() == 3) {
                ((exi) ʾ()).ʽ.setImageResource(e.ͺॱ);
                ((exi) ʾ()).ʽ.setVisibility(0);
            } else if (o_ehz.ʼᐝ() == 7) {
                ((exi) ʾ()).ʽ.setImageResource(e.ˋˋ);
                ((exi) ʾ()).ʽ.setVisibility(0);
            } else {
                ((exi) ʾ()).ʽ.setVisibility(8);
            }
            ((exi) ʾ()).ʻ.setVisibility(ˊᐝ() ? 0 : 4);
        }
    }

    private void ˏ(TextView textView, String str) {
        if (textView != null) {
            if (TextUtils.isEmpty(str)) {
                textView.setVisibility(8);
                return;
            }
            textView.setVisibility(0);
            textView.setText(str);
        }
    }

    public void ॱ(final chy o_chy) {
        ˉ().setOnClickListener(new evx(this) {
            final /* synthetic */ MaterialRelatedListCard ˋ;

            public void ˋ(View view) {
                o_chy.ˏ(0, this.ˋ);
            }
        });
    }
}
